home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15353 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  53 lines

  1. Path: news.cern.ch!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: dos.h equivalent in gcc or cc ?
  5. Date: 18 Apr 96 17:04:39 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Distribution: inet
  8. Message-ID: <danpop.829847079@news.cern.ch>
  9. References: <3173B701.41C6@ieec.fcr.es> <4l5jcr$de1@news.interpath.net>
  10. NNTP-Posting-Host: ues5.cern.ch
  11. Mime-Version: 1.0
  12. Content-Type: text/plain; charset=US-ASCII
  13. Content-Transfer-Encoding: 7bit
  14. X-Newsreader: NN version 6.5.0 #18 (NOV)
  15.  
  16. In <4l5jcr$de1@news.interpath.net> softbase@mercury.interpath.com (Scott McMahan - Softbase Systems) writes:
  17.  
  18. >Oscar Chic (chic@ieec.fcr.es) wrote:
  19. >: I'm trying to pass arguments to a function with _argv and _argc
  20. >: global variables that Borland 4.5 permits.
  21. >: In Borland you must do an include of dos.h
  22. >: Which is the equivalent in gcc or cc in a UNIX WS ?
  23. >: Which file must I include to do the same ?
  24. >
  25. >This sounds like someone has been bitten by non-standard,
  26. >non-portable usage. It's generally easy to work around things
  27. >like this and bzero() using tricks.
  28. >
  29. >Just declare them and then make them have the same values as
  30. >were passed in through the correct variables. 
  31. >
  32. >-*-
  33. >
  34. >int _argc;
  35. >char **_argv;
  36. >
  37. >int main(int argc, char **argv) {
  38. >
  39. >    _argv = argv; _argc = argc;
  40. >}
  41.  
  42. You forgot a small detail:
  43.  
  44. ANSI classic 4.1.2: All external identifiers that begin with an underscore
  45. are reserved.
  46.  
  47. Dan
  48. --
  49. Dan Pop
  50. CERN, CN Division
  51. Email: danpop@mail.cern.ch 
  52. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  53.